import numpy as np
from sklearn import preprocessing,cross_validation,neighbors
import pandas as pd

df = pd.read_csv('breast-cancer-wisconsin.data.txt')
df.replace('?',-99999,inplace=True)
df.drop(['c1'],1,inplace=True)

X = np.array(df.drop(['c11'],1))
Y = np.array(df['c11'])

X_train,X_test,Y_train,Y_test=cross_validation.train_test_split(X,Y,test_size=0.2)
clf= neighbors.KNeighborsClassifier()
clf.fit(X_train,Y_train)
accuracy=clf.score(X_test,Y_test)
print(accuracy)
example_measures =np.array([[4,2,1,1,1,2,3,2,1],[4,2,2,1,2,2,3,2,1]])

prediction = clf.predict(example_measures)
print (prediction)